﻿using IOA.MES.DataAccess.Enum;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace IOA.MES.DataAccess.VModel
{
    /// <summary>
    /// 车间
    /// </summary>
    public class VWorkshop : BaseVModel
    {
        private string _workshopName = string.Empty;
        private string _dutyNames;
        private string _lineNames;
        private string _workshopCode;

        #region Public Property

        ///<Summary>
        /// 车间代码
        ///</Summary>
        public string WorkshopCode
        {
            get { return string.IsNullOrWhiteSpace(_workshopCode) ? string.Empty : _workshopCode; }
            set { _workshopCode = value; }
        }

        ///<Summary>
        /// 车间名称
        ///</Summary>
        public string WorkshopName
        {
            get { return string.IsNullOrWhiteSpace(_workshopName) ? string.Empty : _workshopName; }
            set { _workshopName = value; }
        }

        ///<Summary>
        /// 班次
        ///</Summary>
        public string DutyNames
        {
            get { return string.IsNullOrWhiteSpace(_dutyNames) ? string.Empty : _dutyNames; }
            set { _dutyNames = value; }
        }

        ///<Summary>
        /// 流水线列表
        ///</Summary>
        public string LineNames
        {
            get { return string.IsNullOrWhiteSpace(_lineNames) ? string.Empty : _lineNames; }
            set { _lineNames = value; }
        }

        ///<Summary>
        /// 状态（在建、试运行、投产、暂停、关闭）
        ///</Summary>
        public WorkshopStatus Status { get; set; }

        /// <summary>
        /// 最后入库时间
        /// </summary>
        public DateTime? LastInboundTime { get; set; }

        ///<Summary>
        /// 车间状态
        ///</Summary>
        public string CNStatus
        {
            get { return !System.Enum.IsDefined(typeof(WorkshopStatus), Status) ? string.Empty : EnumConvert.ToDesc(Status); }
        }
        #endregion

        /// <summary>
        /// 流水线列表
        /// </summary>
        public List<VAssemblyLine> Lines { get; set; } = new List<VAssemblyLine>();
    }
}
